package com.zbb.order.api;

import com.zbb.base.model.PageParams;
import com.zbb.base.model.PageResult;
import com.zbb.base.model.Result;
import com.zbb.order.model.dto.OrderInitiateDto;
import com.zbb.order.model.dto.QueryOrderInitiateDto;
import com.zbb.order.service.OrderInitiateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(value = "订单信息查询/编辑接口",tags = "订单信息查询/编辑接口")
@RestController
public class OrderInitiateController {
    @Autowired
    OrderInitiateService orderInitiateService;


    @ApiOperation("发起订单列表查询接口")
    @PostMapping("/getInitiateList")
    public Result getInitiatelist(PageParams pageParams, @RequestBody QueryOrderInitiateDto queryOrderInitiateDto){
        System.out.println(queryOrderInitiateDto);
        PageResult<OrderInitiateDto> orderInitiateDtoList = orderInitiateService.selectOrderInitiate(pageParams,queryOrderInitiateDto);
        return Result.ok(orderInitiateDtoList);
    }

    @ApiOperation("发起订单列表热度查询接口")
    @PostMapping("/getInitiateListByHot")
    public Result getInitiateListByHot(PageParams pageParams){
        PageResult<OrderInitiateDto> orderInitiateDtoList1 = orderInitiateService.selectOrderInitiateByHot(pageParams);
        return Result.ok(orderInitiateDtoList1);
    }
}
